<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改家长')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-patriarch-edit" th:object="${yyPatriarch}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">家长姓名：</label>
                <div class="col-sm-8">
                    <input name="patriarchName" th:field="*{patriarchName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">授课老师：</label>
                <div class="col-sm-8">
                    <input name="stuId" class="form-control" type="hidden">
                </div>
                <div class="col-sm-8">
                    <select id="stuId" class="form-control select2-multiple">
                        <option th:each="stu:${stu}" th:value="${stu.id}" th:text="${stu.stuName}" th:selected="${stu.flag}"></option>
                    </select>
                </div>
            </div>
         <!--   <div class="form-group">
                <label class="col-sm-3 control-label">账号：</label>
                <div class="col-sm-8">
                    <input name="pAccount" th:field="*{userId}" class="form-control" type="text">
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/patriarch";
        $("#form-patriarch-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            // 获取所选下拉框的值
            var selectedteaId = $('#stuId').val();
            // 将所选值赋给隐藏的输入文本框
            $('input[name="stuId"]').val(selectedteaId);
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-patriarch-edit').serialize());
            }
        }
    </script>
</body>
</html>
